This is a Sublime Text 2 and 3 plugin allowing you to format your HTML, CSS, JavaScript, JSON, React and Vue code. It uses a set of nice beautifier scripts made by Einar Lielmanis.
Open a HTML, CSS, JavaScript, JSON, React or Vue file, pop out the console in Sublime Text from View -> Show Console, and type view.run_command("htmlprettify").
Open a file containing HTML. Select HTML code you want to beautify. (If no selection is made the plugin will run on the whole file.) Use the appropriate key command to run HTMLBeautify—or use HTMLBeautify from the Edit menu. You can test the script
I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?
There are plenty of online tools that will unminify your code such as this one, but wouldn't it be nice to have that functionality right inside the Sublime Text editor? Sublime Text doesn't come with a built-in code beautifier but you can install